<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="pu" uri="/WEB-INF/tld/pageutil.tld"%>
<%@taglib prefix="mu" uri="/WEB-INF/tld/mallutil.tld"%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@page import="com.yaodian100.ec.product.service.Product2Service"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<link rel="stylesheet" href="/css/yaodian100_ordercar_v2.css" type="text/css" media="screen" />
<c-rt:set var="imgDomain"><%=ServerValue.getImgDomain()%></c-rt:set>
<%
Product2Service product2Service = (Product2Service)WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext()).getBean(Product2Service.class);
String productId = request.getParameter("productId");
%>
 <script language="javascript">
$().ready(function(){
	$("#dialog").removeClass("collection-dailog-ok");
	$("#dialog").dialog({
		bgiframe: true,
		height: 590,
		width:337,
		modal: true
	});
	$("#presentCloseBtn").click(function(){	
		closeDialog("dialogQuotaFilled");
		return false;
	});
});
</script>
<div id="dialog">
<c-rt:if test="${!empty param.productId}">
${pu:reqSet('currentDate', pu:currentDate()) }
	<c-rt:set scope="request" var="product" value="${pu:get('com.yaodian100.ec.product.entity.Product', param.productId)}" />
	${pu:reqSet('shelf', mu:getActiveShelf(product.productId)) }

	<c-rt:set var="promoteHql" value="from CampaignProduct where uuid=? and productId=?" />
	<c-rt:set var="params" value="${pu:addToList('paras', param.promoteUuid)}" />
	<c-rt:set var="params" value="${pu:addToList('paras', param.productId)}" />

	<c-rt:set var="promoteProducts" value="${pu:queryByHql(promoteHql, params, null)}" />
</c-rt:if>
<c-rt:if test="${param.capture=='true'}">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="description" content="" />
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="expires" content="0"/>
</head>
<body></c-rt:if>
<div class="presentp"><a href="javascript:;">
	<img src="${imgDomain}/PImg/${pu:substring(product.productId, 0, 4)}/${product.productId }/${product.productId }_m250.jpg" onError="this.src='/PImg/blank_250.gif'" alt="" width="250" height="250" /></a>
	<p class="pprice">会员价￥<span><fmt-rt:formatNumber type="number" pattern="0.0#" value="${shelf.shelfPrice}" /></span> <b>加购价￥ <em>
	<%--
	<c:out value="${shelfs.shelfPrice-promoteProducts[0].discount}"/>
	 --%>
<c-rt:set value="${promoteProducts[0].price}" var="price"/>
<fmt-rt:formatNumber type="number" pattern="0.0#" value="${price}" />
	</em></b></p>
</div>
<div class="detail-text"><em>${shelf.promoteName}</em>
<h5>${product.productName }</h5>
<p>${product.productBrief }</p>
<%if ( product2Service.chkVolumeOfProduct(productId)){%>
	<p class="txt-bk"><br />运送限定：<span class="txt-rd">大材积</span><a href="/help/1_bigsize.html" target="_blank">(详情)</a></p>
<%} %>
<p class="txt-bk"><br />商品重量：
	<c-rt:if test="${product.productWeight>0}">
     <fmt-rt:formatNumber value="${(product.productWeight+0.001)/1000 }"  pattern="#,#0.00#"/>
  </c-rt:if>
  <c-rt:if test="${product.productWeight<=0}">0</c-rt:if>
  kg (<a href="/help/6_deliveryfee.html" target="_blank">重量与运费说明</a>)
</p>
</div>
<c-rt:if test="${param.capture=='true'}">
</body></html></c-rt:if>
<p align="center"><a id="presentCloseBtn" href="javascript:;" class="btn-mid">关闭</a></p>
</div>